package com.gtq.uhome.controller;

import com.gtq.uhome.result.Result;
import com.gtq.uhome.service.OrderQuantityService;
import com.gtq.uhome.vo.OrderCountVo;
import com.gtq.uhome.vo.OrderQuantityVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 配送端口_个人中心
 */
@RestController
@RequestMapping(value = "/orderQuantity")
@Api(tags = "配送端口个人中心")
@CrossOrigin
public class OrderQuantityController {

    @Autowired
    private OrderQuantityService orderQuantityService;

    /**
     * 获取用户所有订单数量
     * @param orderQuantityVo 派送员ID
     * @return
     */
    @PostMapping
    @ApiOperation(value = "获取用户所有订单数量")
    public Result<OrderCountVo> findAllOrderQuantity(@RequestBody OrderQuantityVo orderQuantityVo){
        return Result.ok(orderQuantityService.findAllOrderCount(orderQuantityVo),"查询成功");
    }

}
